#define _CRT_SECURE_NO_WARNINGS 1

class Solution {
public:
    string defangIPaddr(string address)
    {
        std::string ans;
        for (const char ch : address)
        {
            if (ch == '.')
            {
                ans += "[.]";
            }
            else
            {
                ans += ch;
            }
        }

        return ans;
    }
};